﻿@using Masa.Blazor
@inherits LayoutComponentBase

<MApp>
    <MAppBar Elevation=0 App MaxHeight=60 Class="px-3 rounded-b-4 white mx-auto" Style="width:90%;">
        <img src="/img/svg/logo-en.svg" />
        <MSpacer />
        <AuthorizeView>
            <Authorized>
                <MMenu OffsetX Left OffsetY>
                    <ActivatorContent Context="activator_context">
                        <MButton Icon Large @attributes="@activator_context.Attrs"><MIcon>mdi-account-circle-outline</MIcon></MButton>
                    </ActivatorContent>
                    <ChildContent>
                        <MList Dense>
                            <MListItem Link OnClick='()=>Navigation("basket")'>
                                <MListItemIcon>
                                    <MIcon>mdi-cart</MIcon>
                                </MListItemIcon>
                                <MListItemContent>
                                    <MListItemTitle>
                                        购物车
                                    </MListItemTitle>
                                </MListItemContent>
                            </MListItem>
                            <MListItem Link OnClick='()=>Navigation("orders")'>
                                <MListItemIcon>
                                    <MIcon>mdi-receipt</MIcon>
                                </MListItemIcon>
                                <MListItemContent>
                                    <MListItemTitle>
                                        订单中心
                                    </MListItemTitle>
                                </MListItemContent>
                            </MListItem>
                            <MListItem Link OnClick='Logout'>
                                <MListItemIcon>
                                    <MIcon>mdi-logout</MIcon>
                                </MListItemIcon>
                                <MListItemContent>
                                    <MListItemTitle>
                                        退出登录
                                    </MListItemTitle>
                                </MListItemContent>
                            </MListItem>
                        </MList>
                    </ChildContent>
                </MMenu>
            </Authorized>
            <NotAuthorized>
                <MMenu>
                    <ActivatorContent Context="_">
                        <MButton class="primary" OnClick='()=>Navigation("login")'>@I18n.T("Login.Login")</MButton>
                    </ActivatorContent>
                </MMenu>
            </NotAuthorized>
        </AuthorizeView>
        <MButton Text OnClick='()=>ChangeLanguage()' class="ml-2">
            @(I18n.Culture.Name == "zh-CN"?"EN": "中")
        </MButton>
    </MAppBar>
    <MMain Class="fill-lighten-1">
        <MContainer Fluid style="width: 90%;" class="px-0">
                @Body
        </MContainer>
    </MMain>
</MApp>

